using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using TudutuRuntime;
using TudutuRuntime.Helpers;
using TudutuActivityLibrary.Tests.Services;
using AppExtensions.Helpers;

namespace AspNetExtensions.Helpers
{
    /// <summary>
    /// AspNetManualLifeflowRuntimeBuilder creates a LifeflowRuntime with a WorkflowRuntime controlled by a manual scheduler service.
    /// This class is suitable for ASP.Net applications.
    /// </summary>
    public class AspNetManualLifeflowRuntimeBuilder : ManualLifeflowRuntimeBuilder
    {
        public override string PersistenceConnectionString
        {
            get
            {
                Guard.ConnectionStringIsConnectable("TudutuWorkflowPersistence");

                string persistenceConnectionString = ConfigurationManager.ConnectionStrings["TudutuWorkflowPersistence"].ConnectionString;
                return persistenceConnectionString;
            }
        }

        public override System.Collections.Generic.IEnumerable<object> Services
        {
            get
            {
                yield return new LocalActionService();
                yield return new LocalActionProvider();
                yield return new LocalUserProvider();
            }
        }
    }
}
